<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
	  xmlns:a4j="http://richfaces.org/a4j"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
 <title>Primefaces with facelet</title>
</h:head>
<h:body>

<ui:composition template="sablon.xhtml">

	<ui:define name="title">mehmet emmy</ui:define>
	<ui:define name="body">
	
	
<h:form id="form">  
  
    <p:dataTable id="adres" var="adr" value="#{adresBean.adresList}" rowKey="#{adr.tckimlik}"  
                 selection="#{adresBean.currentAdres}" selectionMode="single">  
  
        <f:facet name="header">  
            Click "View" button after selecting a row to see details  
        </f:facet>  
  
        <p:column headerText="Id">  
            #{adr.tckimlik}  
        </p:column>  
  
        <p:column headerText="il">  
            #{adr.il}  
        </p:column>  
  
        <p:column headerText="ilce" >  
            #{adr.ilce}  
        </p:column>  
  
        <p:column headerText="mahalle">  
            #{adr.mahalle}  
        </p:column>  
  
        <f:facet name="footer">  
            <p:commandButton id="viewButton" value="View" icon="ui-icon-search"  
                    update=":form:display" oncomplete="adrDialog.show()"/>  
        </f:facet>  
  
    </p:dataTable>  
  
    <p:dialog id="dialog" header="Adres Detail" widgetVar="adrDialog" resizable="false"  
              width="500" showEffect="clip" hideEffect="fold">  
  
        <h:panelGrid id="display" columns="2" cellpadding="4">  
  
            <f:facet name="header">                  
                  <p:graphicImage value="/productImages/lcdtvd.jpg"/>
            </f:facet>  
  
            <h:outputText value="Tc Kimlik:" />  
            <h:outputText value="#{adresBean.currentAdres.tckimlik }" />  
  
            <h:outputText value="il:" />  
            <h:outputText value="#{adresBean.currentAdres.il }" />  
           	
            <h:outputText value="ilce:" />  
            <h:outputText value="#{adresBean.currentAdres.ilce }" />  
  
            <h:outputText value="mahalle:" />  
            <h:outputText value="#{adresBean.currentAdres.mahalle }" />  
        </h:panelGrid>  
    </p:dialog>
</h:form>  
   
    </ui:define>	
</ui:composition>
</h:body>
</html>